package com.fingersoft.feature.webview;

import com.fingersoft.im.utils.AppUtils;
import org.jetbrains.annotations.NotNull;
import cn.fingersoft.util.BuildConfigUtil;

/**
 *
 * @author zhanglongzhi(Roy)
 * @date 2019/5/15
 */
public class SealWebviewCallBackImpl implements IWebViewContext {
    @NotNull
    @Override
    public TokenInfo getTokenInfo() {
        TokenInfo info = new TokenInfo();
        com.fingersoft.im.model.TokenInfo tokenInfo = AppUtils.getTokenInfo();
        if (tokenInfo == null) {
            return info;
        }
        info.setUserToken(tokenInfo.getUserToken());
        info.setDid(tokenInfo.getDid());
        return info;
    }

    @Override
    public boolean useJsapiInOnload() {
        return BuildConfigUtil.INSTANCE.getBoolean("useJsapiInOnload");
    }

    @Override
    public boolean mustWebviewClearCache() {
        return BuildConfigUtil.INSTANCE.getBoolean("mustWebviewClearCache");
    }
}
